package com.qinglian.controller;

import com.qinglian.entity.Find;
import com.qinglian.service.IFindListService;
import com.qinglian.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author augn
 * @since 2023-04-29
 */
@RestController
@CrossOrigin
@RequestMapping("/findList")
public class FindListController {

    @Autowired
    private IFindListService service;

    @GetMapping("/getFindList")
    public Result<?> getFindList(@RequestParam Integer userId, @RequestParam Integer friendId, @RequestParam Integer type){
        return service.getFindList(userId, friendId, type);
    }

    @PostMapping("/addFind")
    public Result<?> addFind(@RequestBody Find find){
        return service.addFind(find);
    }

    @GetMapping("/delFind")
    public Result<?> delFind(@RequestParam Integer findId){
        return service.delFind(findId);
    }
}
